package game.material
{
	import com.yzy.loader.LoaderList;
	import com.yzy.loader.event.LoadInfoEvent;
	
	import flash.events.EventDispatcher;
	
	import game.event.ProcessEvent;
	import game.models.StatusModel;
	
	
	

	public class MateriaLoader extends EventDispatcher
	{
		public final function MateriaLoader()
		{
		}
		
		public function initMaterial():void{
			LoaderList.instant.addEventListener(LoadInfoEvent.COMPLETE_EVENT,loadComplete);
			LoaderList.instant.GetLoaderList("../assist/Material");
		}
		
		private function loadComplete(data:String):void
		{
			//ProfileData.instant.Profile=XML(SetLibs.getLibsData("Profile"));
			//ProfileData.instant.barrier=XML(SetLibs.getLibsData("barrier"));
			var processEvt:ProcessEvent=new ProcessEvent(ProcessEvent.PROCESS_EVENT);
			processEvt.statusName=StatusModel.LOADERMATERIAL;
			processEvt.currStatus=StatusModel.currStatus.end;	
			this.dispatchEvent(processEvt);
		}
		
		private function loaderProgress(bytesTotal:Number,bytesLoaded:Number):void
		{
			
		}
		
		//*****************************************************
		// Singleton 
		//*****************************************************
		private static var _instant:MateriaLoader;
		public static function get instant():MateriaLoader
		{
			if(null == _instant)
			{
				_instant =  new MateriaLoader();
			}
			return _instant;
		}
	}
}